package com.czkevin.examplemod;

import com.czkevin.cif.BaseHeadItem;
import com.czkevin.cif.CIFItemInstance;
import de.tr7zw.nbtapi.NBTCompound;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.EquipmentSlot;

public class ExampleItem extends BaseHeadItem {
    @Override
    public String getDisplayName(NBTCompound data) {
        return "示例物品";
    }

    @Override
    public int[] getHeadOwner() {
        return new int[] {
            // 从 MC-Head s里复制来的十进制UUID数字
            -676048897,1013663968,-1074892218,-1524394657
        };
    }

    @Override
    public String getHeadTexture() {
        // 从 MC-Heads 里复制来的贴图数据
        return "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNWIxZWYyYTQ4MjlhMTFmZDkwM2I1ZTMxMDg4NjYyYThjNTZlNDcxYmI0ODY0M2MwZDlmOTUwMDZkMTgyMDIxMCJ9fX0=";
    }

    @Override
    public void onUseInHand(CIFItemInstance instance, PlayerInteractEvent event) {
        // 如果是主手
        if(event.getHand() == EquipmentSlot.HAND) {
            event.getPlayer().sendMessage("Hello world! ");
        }
    }
}
